<?
include_once("../include/session.php");
include_once("../include/dbConnect.php");

function wrap_text($text,$max){
	$split_text=explode(" ",$text);
	$count=count($split_text);
	for($i=0;$i<$count;$i++){
		$split_text[$i]=(strlen($split_text[$i])>$max?wordwrap($split_text[$i],$max," &nbsp; ",1):$split_text[$i]);
	}
	$collect_text=implode(" ",$split_text);
	return $collect_text;
}


function convertSmiley($text){
	$sql="SELECT * FROM smiley WHERE active='yes'";
	$query=mysql_query($sql);
	$path="../images/smiley";
	while($smiley=mysql_fetch_array($query)){
		$text=str_replace($smiley["code"],"<img src=\"$path/$smiley[file]\" border=\"0\">",$text);
	}
	return $text;
}

function htmlEncode($text){
}

?>